<!--


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

<div id="dashboardDSSearchForm" class="input-group">
    <input type="text" class="filter-input form-control" placeholder="Filter delivery services..." ng-model="search.query">
    <span class="filter-input-group-btn input-group-btn">
        <button ng-show="dsOptions.inactive == true" ng-click="showInactive(false)" class="btn btn-default btn-last" type="button" uib-popover="Hide inactive delivery services" popover-trigger="mouseenter" popover-placement="bottom" popover-append-to-body="true" popover-class="popover-class">Hide Inactive</button>
        <button ng-show="dsOptions.inactive == false" ng-click="showInactive(true)" class="btn btn-default btn-last" type="button" uib-popover="Show inactive delivery services" popover-trigger="mouseenter" popover-placement="bottom" popover-append-to-body="true" popover-class="popover-class">Show Inactive</button>
    </span>
</div>
<table id="dashboardDSTable" class="table">
    <thead>
    <tr>
        <th>ID</th>
        <th><a ng-click="predicate = 'displayName'; reverse = !reverse">Delivery Service Name <i class="fa fa-caret-up fa-fw" ng-show="predicate == 'displayName' && !reverse"></i><i class="fa fa-caret-down fa-fw" ng-show="predicate == 'displayName' && reverse"></i></a></th>
        <th>Bandwidth (24 hrs)</th>
        <th><a ng-click="predicate = 'last'; reverse = !reverse">Last Bandwidth <i class="fa fa-caret-up fa-fw" ng-show="predicate == 'last' && !reverse"></i><i class="fa fa-caret-down fa-fw" ng-show="predicate == 'last' && reverse"></i></a></th>
        <th>Actions</th>
    </tr>
    </thead>
    <tbody>
    <tr class="delivery-service-row" ng-class="{'active': !deliveryService.active}" ng-repeat="deliveryService in deliveryServices | orderBy:predicate:reverse" ng-hide="hideDeliveryService(deliveryService)">
        <td><a class="link" ng-click="navigateToDeliveryService(deliveryService.id)"><span title="{{deliveryService.id}}">{{deliveryService.id}}</span></a></td>
        <td><a class="link" ng-click="navigateToDeliveryService(deliveryService.id)"><span title="{{deliveryService.displayName}} ({{deliveryService.id}} | {{deliveryService.xmlId}})">{{deliveryService.displayName}}</span> <span ng-show="!deliveryService.active">[ inactive ]</span></a></td>
        <td class="delivery-service-sparkline delivery-service-sparkline-{{deliveryService.id}} loading-text"><a class="link" title="Load Bandwidth" ng-click="loadBandwidth(deliveryService.id, true)">Load Bandwidth</a></td>
        <td class="delivery-service-last-{{deliveryService.id}} loading-text" style="min-width:120px;"></td>
        <td style="width:130px;">
            <a class="link" title="Refresh Delivery Service Bandwidth" ng-click="loadBandwidth(deliveryService.id, true)"><i class="fa fa-refresh fa-fw"></i></a>
            <a class="link" title="View Delivery Service Config" ng-click="viewConfig(deliveryService)"><i class="fa fa-cog fa-fw"></i></a>
            <a class="link" title="View Delivery Service in New Window" target="_blank" ui-sref="trafficPortal.private.deliveryService.view.overview.detail({deliveryServiceId:deliveryService.id})"><i class="fa fa-external-link fa-fw"></i></a>
        </td>
    </tr>
    </tbody>
</table>
<div class="alert alert-info" ng-show="deliveryServices.length == 0">
    No delivery services configured for current user
</div>

